/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Id: GammuStateMachine.java 656 2007-06-27 09:32:35Z jack.rybicki $
 */
package gammu.java;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Observable;

import org.apache.commons.lang.NotImplementedException;

public abstract class GammuStateMachine {
	
	private List<GammuObserver> callbacks = new ArrayList<GammuObserver>(1);
	
	public enum ShowNumber {
		SHOW, HIDE, DEFAULT
	}

	public GammuStateMachine () {
		// Default constructor
	}
	
	public synchronized void addIncomingCallback(GammuObserver callback) {
		callbacks.add(callback);
	}

	public synchronized void removeIncomingCallback(GammuObserver callback) {
		callbacks.remove(callback);
	}
	
	public synchronized void removeAllCallbacks() {
		callbacks.clear();
	}
	
	public synchronized int countCallbacks() {
		return callbacks.size();
	}
	
	public void notifyCallbacks(GammuEvent event) {
		for (GammuObserver o : callbacks) {
			o.update(this, event);
		}
	}

	public void answerCall() {
		throw new NotImplementedException();		
	}

	public void cancelCall() {
		throw new NotImplementedException();		
	}

	/**
	 * 
	 * DOCUMENT ME!
	 *
	 * @param number
	 * @param showNumber
	 * @return call id.
	 */
	public int dialVoice(String number, ShowNumber showNumber) {
		throw new NotImplementedException();
	}
	
	public List<String> getAllNetworks() {
		throw new NotImplementedException();
	}
	
	public Map<String, String> getBatteryInfo() {
		throw new NotImplementedException();
	}

	public Map<String, String> getNetworkInfo() {
		throw new NotImplementedException();
	}

	public Map<String, String> getPhoneId() {
		throw new NotImplementedException();
	}
	
	public Map<String, String> getSMS(String folder, int location) {
		throw new NotImplementedException();
	}

	public Map<String, String> getSMSC(int location) {
		throw new NotImplementedException();
	}

	public void init() {
		throw new NotImplementedException();
	}

	public void pressKey(char key, boolean press) {
		throw new NotImplementedException();
	}
	
	public void pressKeySequence(String keys) {
		throw new NotImplementedException();
	}

	public void readConfig(int section) {
		throw new NotImplementedException();
	}

	public void sendSMS(OutgoingSMS value) {
		throw new NotImplementedException();
	}

	public void setConfig(Map attributes) {
		throw new NotImplementedException();
	}

	public void setIncomingCall(boolean enable) {
		throw new NotImplementedException();
	}

	public void setIncmingCB(boolean enable) {
		throw new NotImplementedException();
	}

	public void setIncomingSMS(boolean enable) {
		throw new NotImplementedException();
	}
	
	public void setIncomingUSSD(boolean enable) {
		throw new NotImplementedException();
	}

	public void terminate() {
		throw new NotImplementedException();
	}

}